<!DOCTYPE html>
<html>
	<head>
		<title>求职意向</title>
		<meta charset="utf-8">
		<meta name="Description" content="" />
		<meta name="Keywords" content="" />
		<meta name="format-detection" content="telephone=no, email=no" />
		<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
		<!-- 忽略页面中的数字识别为电话，忽略email识别 -->
		<meta name="applicable-device" content="mobile" />
		<meta name="apple-mobile-web-app-title" content="" />
		<!-- 添加到主屏后的标题（iOS 6 新增） -->
		<meta name="apple-mobile-web-app-capable" content="yes" />
		<!-- 是否启用 WebApp 全屏模式 -->
		<meta name="HandheldFriendly" content="true" />
		<!-- 针对手持设备优化，主要是针对一些老的不识别viewport的浏览器，比如黑莓 -->
		<meta name="author" content="Jack" />
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link rel="stylesheet" type="text/css" href="__STATIC__/module/index/css/min.css" />
		<link rel="stylesheet" href="__STATIC__/module/index/css/mui.min.css" />
	</head>
	<body>
		<div class="rest-box padding-botom">
			<div class="register-box">
				<div class="max-size">填写求职意向</div>

				<div class="input-outer">
					<div class="info-name">自定义职位</div>
					<input type="text" class="input-style name-input" placeholder="填写自定义职位" value="{$info['position']|default=''}" id="post"  onkeyup="words_deal(15,'post','is-txt')" />
					<span class="txt-num"><i id="is-txt">15</i>/15字</span>
				</div>

				<div class="input-outer">
					<div class="info-name">职位类型</div>					
					<div class="postion-icon-1" onclick="isShow_post()" style="position: relative;">
						<input type="text" class="input-style" placeholder="请选择职位类型" position_id="{$info['position_id']|default=''}" value="{$info['positionName']|default=''}" readonly="readonly"  id="position-type" />
						<i class="down-icon"></i>
					</div>															
				</div>

				

			</div>

		</div>
		<div class="postion-btn">
			<div class="next-box">
				<a class="moer-btn" href="javascript:history.back(-1)">返回上一步</a>
				<a class="moer-btn-next" onclick="next_fun()"  href="javascript:;">下一步</a>
			</div>
		</div>
		
		<div class="post-diao">
			<div class="post-type-cen">
				<div class="cha-box">
					<span class="del-icon" onclick="del_diao()"></span>
				</div>
				<div class="post-flex-type">
					<div class="post-left">
						<ul class="post-left-ul" id="kind-left"></ul>
					</div>
					<div class="post-right">
						<ul class="post-right-ul" id="kind-right">
							
						</ul>
					</div>
				</div>
			</div>
		</div>
	</body>
	<script src="__STATIC__/module/index/js/jquery-3.1.0.min.js" type="text/javascript" charset="utf-8"></script>
	<script src="__STATIC__/module/index/js/mui.min.js" type="text/javascript" charset="utf-8"></script>
	<script src="__STATIC__/module/index/js/pub.js" type="text/javascript" charset="utf-8"></script>
	<script src="__STATIC__/module/index/js/api_url.js" type="text/javascript" charset="utf-8"></script>
	<script type="text/javascript" src="__STATIC__/module/index/js/md5/md5.js"></script>
	<script type="text/javascript" src="__STATIC__/module/index/js/md5/access.js"></script>
	<script type="text/javascript">
		$(function(){
			get_post_type();
		})
	</script>
	<script type="text/javascript">
		var is=true;
		function next_fun(){
			var position=$('#post').val();
			var position_id=$('#position-type').attr('position_id');
			if($.trim(position) == ''){
				mui.toast("请输入自定义职位！","text");
				return false;
			}
			if($.trim(position_id) == ''){
				mui.toast("请选择职位类型！","text");
				return false;
			}
			if(is){
				is=false;
				$.post("{:url('twoInfo')}",{position:position,position_id:position_id},function(data){
					if(data.code == 0){
						if(data.is == 1){
							location.href="{:url('index/index')}";
						}else{
							location.href="{:url('experience')}";
						}

					}else{
						is=true;
						mui.toast(data.msg,"text");
					}
				},'json');
			}

			//window.location.href = 'job_experience.html'
		}
		function isShow_post(){
			$('.post-diao').show();
		}
		function del_diao(){
			$('.post-diao').hide();
		}
		
		
		function get_post_type() {
			$.ajax({
				url: basePath + "/position/infoList", //请求的url地址
				dataType: "json", //返回格式为json
				data: {
					access_token: md5
				},
				type: "POST", //请求方式
				success: function(res) {
					if(res.code == 0) {
						var position_type = res.data.position_list; //选择职位
						var position_html = '<li class="list-item" position_id="0">不限</li>';
						var position_detail = '<li class="list-item s0 list-col" position_id="0">不限</li>';
						for(var i in position_type) {
							var catlist = position_type[i].catlist;
							position_html += '<li class="list-item" position_id=' + position_type[i].id + '>' + position_type[i].catname + '</li>';
							position_detail += '<li class="list-item s' + position_type[i].id + ' list-col" style="display:none" position_id=' + position_type[i].id + '>不限</li>';
							for(var j in catlist) {
								position_detail +='<li class="list-item s' + catlist[j].pid + ' list-col" style="display:none" position_id=' + catlist[j].id + '>' + catlist[j].catname + '</li>';
							}
						}
						$('#kind-left').append(position_html);
						$('#kind-right').append(position_detail);
						var left_txt;
						$('#kind-left li').on('click', function() {
							left_txt = $(this).text();
							pid = $(this).attr("position_id");
							$('#kind-left li').removeClass('active-item');
							$(this).addClass('active-item');
							$(".list-col").hide();
							$(".s" + pid).show();
							if($(this).hasClass('active-item')) {
								$('#isshow-li').show();
							} else {
								$('#isshow-li').hide();
							}
						});
						$('#kind-right li').on('click', function() {
							var position_id=$(this).attr('position_id');
							if($(this).text() == '不限') {
								$('#position-type').val(left_txt);
							} else {
								$('#position-type').val($(this).text());
							}
							$("#position-type").attr('position_id',position_id);
							$('.post-diao').hide();
						})

					} else if(res.code == 1000005) {
						layer.msg('你的账号已在其地方登录，请重新登录！');
						setTimeout(function() {
							window.location.href = 'login.html'
						}, 3000)

					} else {
						layer.msg(res.msg);
					}

				},
				error: function(rul) {
					console.log('网络出错')
				}
			});
		}
	</script>
</html>
